# Contributor: Dennis Krupenik <dennis@krupenik.com>
# Maintainer: Dennis Krupenik <dennis@krupenik.com>
pkgname=libvdpau-va-gl
pkgver=0.4.2
pkgrel=0
pkgdesc="VDPAU driver with OpenGL/VAAPI backend"
url="https://github.com/i-rinat/libvdpau-va-gl"
arch="all"
license="MIT"
makedepends="cmake libva-dev mesa-dev"
source="https://github.com/i-rinat/libvdpau-va-gl/archive/v$pkgver/libvdpau-va-gl-$pkgver.tar.gz"
options="!check" # requires a running X server

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		$CMAKE_CROSSOPTS .
	make -C build
}

package() {
	make -C build DESTDIR="$pkgdir" install
}

sha512sums="074f06a0684a28dfd2690d7f878d1e1c1a6a61cb4fba00b54c4b01e9da7baa627333fb59715de0dfb757637afb269c1a62caa3955d53cea75f4a9513c4286680  libvdpau-va-gl-0.4.2.tar.gz"
